package com.example.springboot2022nocv.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.springboot2022nocv.entity.LineTrend;
import com.example.springboot2022nocv.entity.NocvData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 程序员小洋
 * @version 2022.3
 * @date 2022/12/22 17:16
 * @title Index的mapper层
 */
@SuppressWarnings("all")
@Mapper
public interface IndexMapper extends BaseMapper<NocvData> {

    /**
     * 接口: 只有方法定义 不能有实现业务逻辑
     * 1.实现类 写你的业务逻辑
     * 2.XML 写你的业务逻辑
     * 3.注解 @Select ...
     * @return
     */

    @Select("select * from line_trend order by create_time desc limit 7")
    List<LineTrend> findSevenData();

    @Select("select * from nocv_data order by id desc limit 34")
    List<NocvData> listOrderByIdLimit34();
}
